<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Math对象</title>
</head>

<body>
    <script>

        // const max = Math.max(1, 10, 9, 5);
        // const min = Math.min(1, 10, 9, 5);
        // console.log(max, min);

        // let num = 8.4;

        // console.log(Math.ceil(num));
        // console.log(Math.floor(num));
        // console.log(Math.round(num));

        // const num = Math.random();
        // 0-1
        // 0-10
        // 5-15

        // min-max
        // const num = Math.round(Math.random() * 10) + 5;

        function getRandom(min, max) {
            return Math.round(Math.random() * (max - min)) + min;
        }
        console.log(getRandom(5, 9));




        // console.log(num);




    </script>
</body>

</html>